﻿using System;
class ArrayData
{
    public static void Main()
    {
        int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        Console.Write("数组为：");
        for (int i = 0; i < a.Length; i++)
        {

            Console.Write("{0}, ", a[i]);
        }
        Console.WriteLine();

        int maxArray = int.MinValue, minArray = int.MaxValue, avgArray = 0, sum = 0;
        for (int i = 0; i < a.Length; i++)
        {
            if (minArray > a[i])
                minArray = a[i];
            if (maxArray < a[i])
                maxArray = a[i];
            sum += a[i];
        }
        avgArray = sum / a.Length;

        Console.WriteLine("数组最大值为：{0}, 数组最小值为：{1}, 数组平均值为：{2}, 数组和为：{3}", maxArray, minArray, avgArray, sum);
    }
}
